<?php

	class Walk_registration_value extends Model
	{
		
		private $person;
		private $walkInfo;
		
		//SPECIAL CASES
		
		private $insertPerson;
		private $updatePerson;
		private $existingPersonId;

		public function getPerson(){ return Person_value::cast($this->person); }
		public function setPerson( $value ){ $this->person = $value; }

		public function getWalkInfo(){ return Walk_info_value::cast($this->walkInfo); }
		public function setWalkInfo( $value ){ $this->walkInfo = $value; }
		
		public function getInsertPerson(){ return $this->insertPerson; }
		public function setInsertPerson( $value ){ $this->insertPerson = $value; }

		public function getUpdatePerson(){ return $this->updatePerson; }
		public function setUpdatePerson( $value ){ $this->updatePerson = $value; }

		public function getExistingPersonId(){ return $this->existingPersonId; }
		public function setExistingPersonId( $value ){ $this->existingPersonId = $value; }

		
		public function getRegistrationFee()
		{
			$registrationFee = 40;
			if( $this->getWalkInfo()->getIndividualOrFamily() == 'individual')
			{
				$registrationFee = 20;	
			}
			
			return $registrationFee;
		}
		
		
		public function getAdditionalTShirtsFee()
		{
			return $this->getWalkInfo()->getAdditionalTShirts() * 10;
		}
		
		
		public function getTotalFee()
		{
			return $this->getRegistrationFee() + $this->getAdditionalTShirtsFee() + $this->getWalkInfo()->getDonation();
		}

		
		public static function cast(Walk_registration_value $object)
		{
        	return $object;
    	}
	}

?>